package com.bootdo.appsystem.domain;

import com.bootdo.app.htmlVO.car.CarInfo;

import java.io.Serializable;
import java.util.Date;



/**
 * 
 * 
 * @author xiaoxiao
 * @email 806191255@qq.com
 * @date 2018-05-12 14:42:14
 */
public class OrderproductDO implements Serializable {
	private static final long serialVersionUID = 1L;
	
	//订单id
	private Integer oid;
	//用户id
	private Integer uid;
	//支付方式
	private Integer paytype;
	//购买时间
	private Date ordertime;
	//总价
	private Double totalprice;
	//运费
	private Double freight;
	//订单状态
	private Integer ostatus;
	//订单地址
	private String leavemessage;
	//是否评论
	private Integer buycount;
	//订单号
	private String ordercode;
	//订单性质
	private Integer orderparke;
	//商家名称
	private String sellername;
	//商家id
	private Integer sellerid;


	public Integer getSellerid() {
		return sellerid;
	}
	public void setSellerid(Integer sellerid) {
		this.sellerid = sellerid;
	}

	public  String getSellername() {
		return sellername;
	}public void   setSellername(String sellername) {
		this.sellername = sellername;
	}
	/**
	 * 设置：订单id
	 */
	public void setOid(Integer oid) {
		this.oid = oid;
	}
	/**
	 * 获取：订单id
	 */
	public Integer getOid() {
		return oid;
	}
	/**
	 * 设置：用户id
	 */
	public void setUid(Integer uid) {
		this.uid = uid;
	}
	/**
	 * 获取：用户id
	 */
	public Integer getUid() {
		return uid;
	}
	/**
	 * 设置：支付方式
	 * 1、微信扫码订单
	 *
     *
     * 10、商城微信支付订单
	 */
	public void setPaytype(Integer paytype) {
		this.paytype = paytype;
	}
	/**
	 * 获取：支付方式
	 */
	public Integer getPaytype() {
		return paytype;
	}
	/**
	 * 设置：购买时间
	 */
	public void setOrdertime(Date ordertime) {
		this.ordertime = ordertime;
	}
	/**
	 * 获取：购买时间
	 */
	public Date getOrdertime() {
		return ordertime;
	}
	/**
	 * 设置：总价
	 */
	public void setTotalprice(Double totalprice) {
		this.totalprice = totalprice;
	}
	/**
	 * 获取：总价
	 */
	public Double getTotalprice() {
		return totalprice;
	}
	/**
	 * 设置：运费
	 */
	public void setFreight(Double freight) {
		this.freight = freight;
	}
	/**
	 * 获取：运费
	 */
	public Double getFreight() {
		return freight;
	}
	/**
	 * 设置：订单状态
     * 0、未支付
     * 1、已支付
     * -1、已删除
	 */
	public void setOstatus(Integer ostatus) {
		this.ostatus = ostatus;
	}
	/**
	 * 获取：订单状态
	 */
	public Integer getOstatus() {
		return ostatus;
	}
	/**
	 * 设置：买家留言
	 */
	public void setLeavemessage(String leavemessage) {
		this.leavemessage = leavemessage;
	}
	/**
	 * 获取：买家留言
	 */
	public String getLeavemessage() {
		return leavemessage;
	}
	/**
	 * 设置：是否评论
	 */
	public void setBuycount(Integer buycount) {
		this.buycount = buycount;
	}
	/**
	 * 获取：是否评论
	 */
	public Integer getBuycount() {
		return buycount;
	}
	/**
	 * 设置：订单号
	 */
	public void setOrdercode(String ordercode) {
		this.ordercode = ordercode;
	}
	/**
	 * 获取：订单号
	 */
	public String getOrdercode() {
		return ordercode;
	}
	/**
	 * 设置：订单性质
     *
     *      1、未支付
	 *      2、微信支付
	 *      3、离线
	 *      4、手动订单
	 *      5、普通订单
	 *      6、其他订单
	 *      7、离线
     *
     * 		10、商城订单
	 */
	public void setOrderparke(Integer orderparke) {
		this.orderparke = orderparke;
	}
	/**
	 * 获取：订单性质
	 */
	public Integer getOrderparke() {
		return orderparke;
	}


    /**
     * 创建一个新的商城商品订单信息
     *
     * @return
     */
	public OrderproductDO creatNewGoodsOrderProductInfo(Integer uid,String code,CarInfo carinfo){
        OrderproductDO orderproduct = new OrderproductDO();
        orderproduct.setUid(uid);
        orderproduct.setOrdercode(code);
        orderproduct.setBuycount(0);
        orderproduct.setLeavemessage(carinfo.getSellerImage());
        orderproduct.setOrderparke(1);
        orderproduct.setOrdertime(new Date());
        orderproduct.setOstatus(0);
        //未支付
        orderproduct.setPaytype(10);
        orderproduct.setSellerid(carinfo.getSellerId());
        orderproduct.setSellername(carinfo.getSellerName());
        return orderproduct;
    }


}
